/*
 * XML Type:  XNumberRange
 * Namespace: http://www.seedwill.com/xul/widget/
 * Java type: com.seedwill.xul.widget.XNumberRange
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.widget.impl;
/**
 * An XML XNumberRange(@http://www.seedwill.com/xul/widget/).
 *
 * This is a complex type.
 */
public class XNumberRangeImpl extends com.seedwill.xul.widget.impl.XInputImpl implements com.seedwill.xul.widget.XNumberRange
{
    private static final long serialVersionUID = 1L;
    
    public XNumberRangeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName MAX$0 = 
        new javax.xml.namespace.QName("", "max");
    private static final javax.xml.namespace.QName MIN$2 = 
        new javax.xml.namespace.QName("", "min");
    private static final javax.xml.namespace.QName STEP$4 = 
        new javax.xml.namespace.QName("", "step");
    private static final javax.xml.namespace.QName NUMELEMENT$6 = 
        new javax.xml.namespace.QName("", "numElement");
    
    
    /**
     * Gets the "max" element
     */
    public java.math.BigDecimal getMax()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MAX$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getBigDecimalValue();
        }
    }
    
    /**
     * Gets (as xml) the "max" element
     */
    public org.apache.xmlbeans.XmlDecimal xgetMax()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlDecimal target = null;
            target = (org.apache.xmlbeans.XmlDecimal)get_store().find_element_user(MAX$0, 0);
            return target;
        }
    }
    
    /**
     * True if has "max" element
     */
    public boolean isSetMax()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MAX$0) != 0;
        }
    }
    
    /**
     * Sets the "max" element
     */
    public void setMax(java.math.BigDecimal max)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MAX$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(MAX$0);
            }
            target.setBigDecimalValue(max);
        }
    }
    
    /**
     * Sets (as xml) the "max" element
     */
    public void xsetMax(org.apache.xmlbeans.XmlDecimal max)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlDecimal target = null;
            target = (org.apache.xmlbeans.XmlDecimal)get_store().find_element_user(MAX$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlDecimal)get_store().add_element_user(MAX$0);
            }
            target.set(max);
        }
    }
    
    /**
     * Unsets the "max" element
     */
    public void unsetMax()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MAX$0, 0);
        }
    }
    
    /**
     * Gets the "min" element
     */
    public java.math.BigDecimal getMin()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MIN$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getBigDecimalValue();
        }
    }
    
    /**
     * Gets (as xml) the "min" element
     */
    public org.apache.xmlbeans.XmlDecimal xgetMin()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlDecimal target = null;
            target = (org.apache.xmlbeans.XmlDecimal)get_store().find_element_user(MIN$2, 0);
            return target;
        }
    }
    
    /**
     * True if has "min" element
     */
    public boolean isSetMin()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MIN$2) != 0;
        }
    }
    
    /**
     * Sets the "min" element
     */
    public void setMin(java.math.BigDecimal min)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MIN$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(MIN$2);
            }
            target.setBigDecimalValue(min);
        }
    }
    
    /**
     * Sets (as xml) the "min" element
     */
    public void xsetMin(org.apache.xmlbeans.XmlDecimal min)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlDecimal target = null;
            target = (org.apache.xmlbeans.XmlDecimal)get_store().find_element_user(MIN$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlDecimal)get_store().add_element_user(MIN$2);
            }
            target.set(min);
        }
    }
    
    /**
     * Unsets the "min" element
     */
    public void unsetMin()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MIN$2, 0);
        }
    }
    
    /**
     * Gets the "step" element
     */
    public java.math.BigDecimal getStep()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(STEP$4, 0);
            if (target == null)
            {
                return null;
            }
            return target.getBigDecimalValue();
        }
    }
    
    /**
     * Gets (as xml) the "step" element
     */
    public org.apache.xmlbeans.XmlDecimal xgetStep()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlDecimal target = null;
            target = (org.apache.xmlbeans.XmlDecimal)get_store().find_element_user(STEP$4, 0);
            return target;
        }
    }
    
    /**
     * True if has "step" element
     */
    public boolean isSetStep()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(STEP$4) != 0;
        }
    }
    
    /**
     * Sets the "step" element
     */
    public void setStep(java.math.BigDecimal step)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(STEP$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(STEP$4);
            }
            target.setBigDecimalValue(step);
        }
    }
    
    /**
     * Sets (as xml) the "step" element
     */
    public void xsetStep(org.apache.xmlbeans.XmlDecimal step)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlDecimal target = null;
            target = (org.apache.xmlbeans.XmlDecimal)get_store().find_element_user(STEP$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlDecimal)get_store().add_element_user(STEP$4);
            }
            target.set(step);
        }
    }
    
    /**
     * Unsets the "step" element
     */
    public void unsetStep()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(STEP$4, 0);
        }
    }
    
    /**
     * Gets array of all "numElement" elements
     */
    public com.seedwill.xul.widget.XTextBox[] getNumElementArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(NUMELEMENT$6, targetList);
            com.seedwill.xul.widget.XTextBox[] result = new com.seedwill.xul.widget.XTextBox[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "numElement" element
     */
    public com.seedwill.xul.widget.XTextBox getNumElementArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XTextBox target = null;
            target = (com.seedwill.xul.widget.XTextBox)get_store().find_element_user(NUMELEMENT$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "numElement" element
     */
    public int sizeOfNumElementArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(NUMELEMENT$6);
        }
    }
    
    /**
     * Sets array of all "numElement" element
     */
    public void setNumElementArray(com.seedwill.xul.widget.XTextBox[] numElementArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(numElementArray, NUMELEMENT$6);
        }
    }
    
    /**
     * Sets ith "numElement" element
     */
    public void setNumElementArray(int i, com.seedwill.xul.widget.XTextBox numElement)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XTextBox target = null;
            target = (com.seedwill.xul.widget.XTextBox)get_store().find_element_user(NUMELEMENT$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(numElement);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "numElement" element
     */
    public com.seedwill.xul.widget.XTextBox insertNewNumElement(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XTextBox target = null;
            target = (com.seedwill.xul.widget.XTextBox)get_store().insert_element_user(NUMELEMENT$6, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "numElement" element
     */
    public com.seedwill.xul.widget.XTextBox addNewNumElement()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XTextBox target = null;
            target = (com.seedwill.xul.widget.XTextBox)get_store().add_element_user(NUMELEMENT$6);
            return target;
        }
    }
    
    /**
     * Removes the ith "numElement" element
     */
    public void removeNumElement(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(NUMELEMENT$6, i);
        }
    }
}
